package reportily

import (
	"zy10/global"
	"zy10/model"
)

func AddFriend(userId uint, userTwoId uint, status uint) (friendapply model.FriendApply, err error) {
	friendapply = model.FriendApply{

		UserId:    userId,
		UserTwoId: userTwoId,
		Status:    status,
	}
	err = global.DB.Create(&friendapply).Error
	if err != nil {
		return model.FriendApply{}, err
	}
	return friendapply, nil
}

func Addfinly(id uint) (user model.User, err error) {
	err = global.DB.Where("id = ?", id).Find(&user).Error
	if err != nil {
		return model.User{}, err
	}
	return user, nil
}
